Scan Codes
The scan codes for the keys on a keyboard are arranged as they appear on a qwerty keyboard. In other words the numbers are 1,2,3... 8,9,0 and the letters are q to p, a to l and z to m.
The first codes are when the key is pressed down, the second, when the key is released. NB: The second code is always 256 higher than the first.
Numbers
1 = 2/258
2 = 3/259
3 = 4/260
...
8 = 9/265
9 = 10/266
0 = 11/267
Letters
q = 16/272, w = 17/273 ... o = 24/280, p = 25/281
a = 30/286, s = 31/287 ... k = 37/293, l = 38/294
z = 44/300, x = 45/301 ... n = 49/305, m = 50/306
Other Useful Keys
Escape = 1/257
Return = 28/284
Spacebar = 57/313
L. Control = 29/285
L. Shift = 42/298
L. Alt = 56/312
Up cursor = 200/456
Down cursor = 208/464
Left cursor = 203/459
Right cursor = 205/461